package com.leyu.mall.admin.goods.service.impl;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.leyu.mall.admin.goods.dao.GoodsStorePriceMapper;
import com.leyu.mall.admin.goods.domain.GoodsStorePrice;
import com.leyu.mall.admin.goods.service.IGoodsStorePriceService;
import com.leyu.mall.common.facade.IGoodsStorePriceFacade;

@Service
@Transactional(rollbackFor = Exception.class)
public class GoodsStorePriceServiceImpl implements IGoodsStorePriceService,IGoodsStorePriceFacade {

	@Resource(name = "goodsStorePriceMapper")
	private GoodsStorePriceMapper goodsStorePriceMapper;

	public GoodsStorePrice getGoodsStorePriceById(Long entity_id) throws Exception {
		return goodsStorePriceMapper.getGoodsStorePriceById(entity_id);
	}

	public void save(GoodsStorePrice entity) throws Exception {
		if (entity.getGoodsId() == null) {
			goodsStorePriceMapper.addGoodsStorePrice(entity);

		} else {

			goodsStorePriceMapper.updateByPrimaryKey(entity);
		}
	}
	public void deleteGoodsStorePrice(Long id) throws Exception {
		goodsStorePriceMapper.deleteGoodsStorePrice(id);
	}
	public List<GoodsStorePrice> getAllGoodsStorePrice() throws Exception {
		return goodsStorePriceMapper.getAllGoodsStorePrice();

	}
	
 
	
}